package GUI.TabPanel;

import javax.swing.GroupLayout;
import javax.swing.JPanel;
import javax.swing.LayoutStyle;

import GUI.List.FileList;

public class DataView extends JPanel {

	
	private FileList list = new FileList();
	private FileView view = new FileView();
	private String Mac_ID;
	
	public void reFresh(Object SelectObject) {
		
		if(SelectObject != null) {
			Mac_ID = (String) SelectObject;
			list.reFresh(Mac_ID);
			view.setMac_ID(Mac_ID);
		}
	}
	
	public DataView() {
		add(list);
		add(view);
		list.setView(view);
		
		GroupLayout jPanel1Layout = new GroupLayout(this);
        this.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(list, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGap(35)
                .addComponent(view, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            //.addComponent(glue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGap(35)
            .addComponent(view, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(list, GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE)
        );
        
	}
}
